#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>

QT_BEGIN_NAMESPACE
namespace Ui { class Widget; }
QT_END_NAMESPACE

class Widget : public QWidget
{
    Q_OBJECT

public:
    Widget(QWidget *parent = nullptr);
    ~Widget();

    void contextMenuEvent(QContextMenuEvent *event) override;
    void reloadTextFile(QString codeName);
protected slots:
    void slotChangeTextCode(bool);
    void slotOpenFile(bool);

private:
    QString GetCorrectUnicode(const QByteArray &text,QString codeName="utf8");
private:
    Ui::Widget *ui;
    QString m_filePath;
    bool bLoad = false;
};
#endif // WIDGET_H
